//
//  MCCheckOrderCell.swift
//  StoreManage
//
//  Created by MC on 2018/6/22.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

class MCCheckOrderCell: UITableViewCell {

    
    var model = MCCheckOrderModel() {
        didSet {
            orderNoLabel.text = "订单编号:" + model.orderSn
            nameLabel.text = model.linkMan
            timeLabel.text = model.updateTime
            phoneLabel.text = model.mobile
        }
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        self.addSubview(bgView)
        bgView.snp.remakeConstraints { (make) ->Void in
            make.edges.equalTo(self).inset(UIEdgeInsetsMake(0, 0, 1, 0))
        }
        
        bgView.addSubview(orderNoLabel)
        orderNoLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(bgView).offset(15)
            make.bottom.equalTo(bgView.snp.centerY).offset(-2)
        }
        
        bgView.addSubview(nameLabel)
        nameLabel.snp.remakeConstraints { (make) ->Void in
            make.right.equalTo(bgView).offset(-15)
            make.centerY.equalTo(orderNoLabel)
        }

        bgView.addSubview(timeLabel)
        timeLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(bgView).offset(15)
            make.top.equalTo(bgView.snp.centerY).offset(2)
        }
        
        bgView.addSubview(phoneLabel)
        phoneLabel.snp.remakeConstraints { (make) ->Void in
            make.right.equalTo(bgView).offset(-15)
            make.centerY.equalTo(timeLabel)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var bgView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.white
        return view
    }()
    
    lazy var orderNoLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(14)
        label.textColor = UIColor.MCWords
        return label
    }()

    lazy var nameLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(14)
        label.textColor = UIColor.MCWords
        return label
    }()

    lazy var timeLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(14)
        label.textColor = UIColor.MCGray
        return label
    }()

    lazy var phoneLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(14)
        label.textColor = UIColor.MCWords
        return label
    }()

}
